#!/usr/bin/env python
import nltk
import csv
import sys
from math import log

def get_data(filename):
    print 'Getting data from %s'%filename
    with open(filename, 'r') as csvfile:
        return [row for row in csv.DictReader(csvfile, delimiter=',', quotechar='"')]
def get_distributions(data):
    dist = {}
    for row in data:
        if row['OpenStatus'] not in dist:
            dist[row['OpenStatus']] = 0
        dist[row['OpenStatus']]+=1
    sum = 0
    for key,val in dist.items():
        sum += val
    for key,val in dist.items():
        dist[key]*= 100/float(sum)
    return dist
if __name__ == '__main__':
    data = get_data(sys.argv[1])
    print get_distributions(data)
